Prv8 Shell
Server : Apache
System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
User : matalashes ( 1004)
PHP Version : 8.1.29
Disable Function : NONE
Directory :  /home/matalashes/.trash/app/Models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/matalashes/.trash/app/Models/PsStoreAccess.php
<?php

namespace App\Models;

use CodeIgniter\Model;

class PsStoreAccess extends Model
{
    protected $DBGroup = 'default';
    protected $table = 'ps_store_access';
    protected $primaryKey = 'ps_sa_id';
    protected $useAutoIncrement = true;
    protected $insertID = 0;
    protected $returnType = 'object';
    protected $useSoftDeletes = true;
    protected $protectFields = true;
    protected $allowedFields = ['list', 'list_with_action', 'updated_at'];

    // Dates
    protected $useTimestamps = true;
    protected $dateFormat = 'datetime';
    protected $createdField = 'created_at';
    protected $updatedField = 'updated_at';
    protected $deletedField = 'deleted_at';

    // Validation
    protected $validationRules = [];
    protected $validationMessages = [];
    protected $skipValidation = false;
    protected $cleanValidationRules = true;

    // Callbacks
    protected $allowCallbacks = true;
    protected $beforeInsert = [];
    protected $afterInsert = [];
    protected $beforeUpdate = [];
    protected $afterUpdate = [];
    protected $beforeFind = [];
    protected $afterFind = [];
    protected $beforeDelete = [];
    protected $afterDelete = [];

    public static function get_by_role_id($role_id)
    {
        $model = new PsStoreAccess();
        return $model->getWhere(['ps_sr_id' => $role_id])->getFirstRow();
    }

    public static function get_by_role_id_uri($role_id, $uri)
    {
        $model = new PsStoreAccess();
        return $model->where('ps_sr_id', $role_id)->like('list_with_action', $uri)->first();
    }
    
    public function fieldExist($field_name)
    {
        $db = \Config\Database::connect();
        return $db->fieldExists($field_name, 'ps_store_access');
    }
}

haha - 2025